package io.github.frailty9.crserver.model

import java.time.LocalDateTime
import com.mybatisflex.annotation.Column
import com.mybatisflex.annotation.Id
import java.time.LocalTime

/**
 * 周期性资源实例模板
 */
data class ResourceInstanceTemplate(
    @Id
    override var id: Long? = null,
    /**
     * resource_id
     */
    var resourceId: Long? = null,
    /**
     * 每日开始时间（如 07:00:00）
     */
    var startTime: LocalTime? = null,
    /**
     * 每日结束时间（如 09:00:00）
     */
    var endTime: LocalTime? = null,
    /**
     * 最大可预约单位数
     */
    var capacityUnits: Int? = null,
    /**
     * 1=周一, ..., 7=周日
     */
    var daysOfWeek: String?? = null,
    /**
     * 1~31
     */
    var daysOfMonth: String?? = null,

    @Column(version = true)
    override var version: Int? = null,

    @Column(onInsertValue = "CURRENT_TIMESTAMP")
    var createTime: LocalDateTime? = null,

    @Column(onInsertValue = "CURRENT_TIMESTAMP", onUpdateValue = "CURRENT_TIMESTAMP")
    var updateTime: LocalDateTime? = null,

    @Column(isLogicDelete = true)
    override var deleted: Int? = null
) : BaseModel
